package cn.uo86.mail.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DbHelper extends SQLiteOpenHelper {

	public DbHelper(Context context) {
		super(context, Tab_Info.DBNAME, null, 1);
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		 db.execSQL("CREATE TABLE "
				 +Tab_Info.TB_MAIL+"("
				 +Tab_Info.ID+" integer primary key autoincrement,"
				 +Tab_Info.NAME+" varchar(10),"
				 +Tab_Info.URL+" varchar(10),"
				 +Tab_Info.SEQ+" Integer,"
				 +Tab_Info.ISSELECTED+" boolean,"
				 +Tab_Info.ISMAIN+" boolean)");
//		db.execSQL(
//				"CREATE TABLE ?(CC integer primary key autoincrement)",new String[]{"dd"});
				//new Object[]{ TableInfo.TABLENAME_MAIL});// TableInfo.ID});//,
//						TableInfo.NAME, TableInfo.URL, TableInfo.SEQ,
//						TableInfo.ISSELECTED, TableInfo.ISMAIN });
		//,? varchar(10),? varchar(10),? integer,? varchar(5),? varchar(5))",

	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("ALTER TABLE mail ADD test varchar(12) NULL");

	}

}
